﻿<?xml version="1.0" encoding="utf-8" ?>
<Database Name="MvcEngine" xmlns="http://schemas.microsoft.com/linqtosql/mapping/2007">
  <Table Name="dbo.Polls" Member="MvcEngine.Poll.LinqToSqlProvider.Poll">
    <Type Name="MvcEngine.Poll.LinqToSqlProvider.Poll">

      <Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" IsDbGenerated="false" CanBeNull="false"/>
      <Column Name="PageContentId" Member="PageContentId" DbType="Int" CanBeNull="false"/>
      <Column Name="Question" Member="Question" DbType="NVarChar(Max)" CanBeNull="false"/>
      <Column Name="Activated" Member="Activated" DbType="Bit" CanBeNull="false"/>
      <Column Name="ExpirationDate" Member="ExpirationDate" DbType="DateTime" CanBeNull="true"/>
      <Column Name="CreatedBy" Member="CreatedBy" DbType="Int" CanBeNull="true"/>
      <Column Name="ModifiedBy" Member="ModifiedBy" DbType="Int" CanBeNull="true"/>
      <Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
      <Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>

      <Association Name="FK_Polls_PageContents"
						Member="PageContents"
						ThisKey="PageContentId"
						OtherKey="Id"
						IsForeignKey="true" />

      <Association Name="FK_Polls_Users"
			      Member="Users"
			      ThisKey="ModifiedBy"
			      OtherKey="Id"
			      IsForeignKey="true" />

      <Association Name="FK_Polls_Users0"
			      Member="Users"
			      ThisKey="CreatedBy"
			      OtherKey="Id"
			      IsForeignKey="true" />

    </Type>
  </Table>

  <Table Name="dbo.PollQuestions" Member="MvcEngine.Poll.LinqToSqlProvider.PollAnswer">
    <Type Name="MvcEngine.Poll.LinqToSqlProvider.PollAnswer">

      <Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" IsDbGenerated="false" CanBeNull="false"/>
      <Column Name="PollId" Member="PollId" DbType="uniqueidentifier" CanBeNull="false"/>
      <Column Name="Answer" Member="Answer" DbType="NVarChar(Max)" CanBeNull="false"/>
      <Column Name="Vote" Member="Vote" DbType="Int" CanBeNull="false"/>
      
      <Column Name="CreatedBy" Member="CreatedBy" DbType="Int" CanBeNull="true"/>
      <Column Name="ModifiedBy" Member="ModifiedBy" DbType="Int" CanBeNull="true"/>
      <Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
      <Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>

      <Association Name="FK_PollAnswer_Polls"
						Member="Polls"
						ThisKey="PollId"
						OtherKey="Id"
						IsForeignKey="true" />

      <Association Name="FK_PollAnswer_Users"
			      Member="Users"
			      ThisKey="CreatedBy"
			      OtherKey="Id"
			      IsForeignKey="true" />

      <Association Name="FK_PollAnswer_Users1"
			      Member="Users"
			      ThisKey="ModifiedBy"
			      OtherKey="Id"
			      IsForeignKey="true" />

    </Type>
  </Table>
</Database>